SetSectionColor
Use this procedure/function to assign or change the background color property assigned to a given section on a page.
Syntax:
SetSectionColor (PrefixName, Section, Form, Group)
Parameter |
Description |
Required |
PrefixName |
A prefix name to be associated with the color attributes to set for this section. The sub-attributes are “.red”, “.green”, “.blue”, and “.options” which should be appended to the prefix name. |
Yes |
Section |
The name of an existing section in the form set. |
Defaults to current section. |
Form |
Name of a form within the form set that contains the section. |
Defaults to current form. |
Group |
Name of the form group that contains the form and section. |
Defaults to current form group. |
This sets the section background color by using the PrefixName parameter to find the associated color attribute values:
prefixName.red
prefixName.green
prefixName.blue
prefixName.options
Document colors are managed by using a RGB (red, green, blue) value combination. Each color component can be in the range of 0 to 255. The combination of the values determines the overall colors. If all color components are set at 0, the color is black. Similarly, if all are set at 255, white is the color. By adjusting the red, green, and blue components, you can create any color in the rainbow.
The “.options” value determines what the section does with your new color assignment.
0 = return the section to have no color value. The red, green, blue attribute values are ignored.
1 = assign the color to be visible when viewing the section.
3 = assign the color to be visible and to also indicate to print this color when creating PDF output.
Example:
Procedure |
Result |
Explanation |
MyColor.red = 128 MyColor.green = 0 MyColor.blue = 0 MyColor.options = 1 SetSectionColor ("MyColor") |
Assigned a new color to the section |
When the options value is 1, the section color is assigned the red, green, and blue values and this color will be visible when the document is displayed in an entry system. |
MyColor.options = 0 SetSectionColor ("MyColor") |
Reset the section to no color. |
When the options value is 0, the section color is reset to the default – no color. |
Bkcolor.red = 128 Bkcolor.green = 128 Bkcolor.blue = 128 Bkcolor.options = 3 SetSectionColor ( "bkcolor", "MVF\2", "XYZ") |
Assign a color to the section for viewing and to print to PDF. |
The second occurrence of the section MVF on the form XYZ is assigned the color values. Options=3 means the color is visible during entry and will also print when Send Color is specified for print. |
Take note in the examples how the prefixName parameter must be specified as a string value. That is why the parameter has quotes around the prefixed name.1